using System;

namespace ZombieHigh2.Inventory
{
    public class PlayerInventory
    {
        int sprayCanAmmo;
        bool hasKnife;
        bool hasSprayCan;

        const int AMMO_SPRAY_CAN_AMOUNT = 5;
        const int MAX_SPRAY_CAN_AMMO = 25;

        public bool HasKnife
        {
            get { return hasKnife; }
        }

        public bool HasSprayCan
        {
            get { return hasSprayCan; }
        }

        public int SprayCanAmmo
        {
            get { return sprayCanAmmo; }
        }

        public PlayerInventory()
        {
            sprayCanAmmo = 0;
            hasKnife = false;
            hasSprayCan = false;
        }

        public void AddSprayCan()
        {
            hasSprayCan = true;
            AddSprayCanAmmo(AMMO_SPRAY_CAN_AMOUNT);
        }

        public void AddKnife()
        {
            hasKnife = true;
        }

        void AddSprayCanAmmo(int amount)
        {
            sprayCanAmmo += amount;

            if (sprayCanAmmo > MAX_SPRAY_CAN_AMMO)
            {
                sprayCanAmmo = MAX_SPRAY_CAN_AMMO;
            }
        }

        public void DropKnife()
        {
            hasKnife = false;
        }

        public void DropSprayCan()
        {
            hasSprayCan = false;
            sprayCanAmmo = 0;
        }

    }
}
